﻿using System;
using System.IO;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;

namespace mb
{
    public partial class App
    {
        public static ILog logger;
        public static API.IStartOption StartOption;
        public static Tuple<string, int> AssetServerURI = new Tuple<string, int>("mb.test.com", 19380);
        public static string HotStorageRoot { get; set; }
        public static string CurrentServerUrl { get; set; }
        public static ServerLoader AServerLoader { get; set; }
        public static bool HasTestFlag { get; set; }

        public static void Initialize()
        {
            ServiceLocator.Instance.Register<ILog, Logger>();
#if __ANDROID__
            ServiceLocator.Instance.Register<IHotLoader, MonoLoader>();
#endif

#if __IOS__
            // ServiceLocator.Instance.Register<IHotLoader, MonoLoader>();
            ServiceLocator.Instance.Register<IHotLoader, ILRLoader>();
#endif
            ServiceLocator.Instance.Register<API.IAssetUpdater, AssetUpdater>();
            ServiceLocator.Instance.Register<API.ICacheDataStreamManager, CacheStreamManger>();
            ServiceLocator.Instance.Register<API.IServerProber, ServerProber>();
            ServiceLocator.Instance.Register<API.IStartOption, StartOption>();

            logger = mb.ServiceLocator.Instance.Get<ILog>();
            StartOption = ServiceLocator.Instance.Get<API.IStartOption>();
        }

    }

}